
macro haddps arg1, arg2
{
   push    ebp
   mov     ebp,esp
   sub     esp,31
   and     ebp,-16
   movaps  [ebp-16],arg2
   shufps  arg1,arg1,10110001b
   addps   arg1,[ebp-16]
   shufps  arg1,arg1,11001100b
   add     esp,31
   pop     ebp
}

macro hsubps arg1,arg2
{
   push    ebp
   mov     ebp,esp
   sub     esp,47
   and     ebp,-16
   movaps  [ebp-16],arg2
   shufps  arg1,arg1,10110001b
   subps   arg1,[ebp-16]
   movaps  [ebp-32],arg1
   movaps  arg2,[ebp-16]
   movaps  arg1,[ebp-32]

;   subps   arg2,arg1
;   movaps  arg1,arg2
;   subps   arg1,[ebp-16]
   shufps  arg1,arg1,11011101b
   add     esp,47
   pop     ebp
}



macro addsubps arg1, arg2
{
   push    ebp
   mov     ebp,esp
   sub     esp,56
   and     ebp,-16
   movaps  [ebp-16],arg2
   movaps  [ebp-32],arg1
   addps   arg1,arg2
   
   shufps  arg1,arg1,00001101b  ; lowest - add  
   movlps  [ebp-48],arg1
   movaps  arg1,[ebp-32]
   subps   arg1,[ebp-16]
   shufps  arg1,arg1,10000000b  ; hst - sub  
   movaps  arg2,[ebp-16]
   movlps  arg1,[ebp-48]
   shufps  arg1,arg1,01110010b
   add     esp,56
   pop     ebp
}



